import { handleTree } from "@/utils/service";

export function getData(vue,query,success,finallyFuc= f=> {}){
  vue.$request.post({
    url: "product/trafficSourceOptions/getListNotBaseField",
    params: query,
    success: r => {
      success(handleTree(r,"id","parentId","children",0))
    },
    finally: finallyFuc
  })
}

export function create(vue,param,success,finallyFuc= f=> {}){
  vue.$request.post({
    url: "product/trafficSourceOptions/create",
    params: param,
    success: success,
    finally: finallyFuc
  })
}

export function update(vue,param,success,finallyFuc= f=> {}){
  vue.$request.post({
    url: "product/trafficSourceOptions/update",
    params: param,
    success: success,
    finally: finallyFuc
  })
}

export function remove(vue,param,success,finallyFuc= f=> {}){
  vue.$request.post({
    url: "product/trafficSourceOptions/delete",
    params: param,
    success: success,
    finally: finallyFuc
  })
}